<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS动画效果(过渡)</title>
    <script src="../vue.js"></script>
    <link rel="stylesheet" type="text/css" href="../animate.css">
    <style>
        .fade-enter,.fade-leave-to{
            opacity: 0
        }
        .fade-enter-active,.fade-leave-active{
            transition: opacity 3s;
        }
    </style>
<!--    <style>-->
<!--        @keyframes bounce-in {-->
<!--            0%{-->
<!--                transform:scale(0);-->
<!--            }-->
<!--            50%{-->
<!--                transform:scale(1.5);-->
<!--            }-->
<!--            100%{-->
<!--                transform:scale(1);-->
<!--            }-->
<!--        }-->
<!--        .fade-enter-active{-->
<!--            transform-origin: left center;-->
<!--            animation: bounce-in 1s;-->
<!--        }-->
<!--        .fade-leave-active{-->
<!--            transform-origin: left center;-->
<!--            animation: bounce-in 1s reverse;-->
<!--        }-->
<!--    </style>-->
</head>
<body>
<div id="root">
    <!--appear 刷新动画-->
    <transition
            type="transition"
            name="fade"
            appear
            enter-active-class="animated shake fade-enter-active"
            leave-active-class="animated swing fade-leave-active"
            appear-active-class = "animated swing"
            >
        <div v-if="show">
            hello world
        </div>
    </transition>
    <button @click="handleClick"> Toggle </button>


</div>

<script>
    var vm = new Vue({
        el:"#root",
        data:{
            show:true
        },
        methods:{
            handleClick:function () {
                this.show = !this.show
            }
        }
    })
</script>

</body>
</html>